#pragma once

#include "FilerFrogElement.h"

class FileMachine : FilerFrogElement
{
private:
	
	/* Path Elements */

	wstring m_filePath;
	wstring m_fileNamePlusExt;
	wstring m_fileNameNoExt;
	wstring m_fileExt;
	wstring m_fileFolder;
	wstring m_filePathPlusNameNoExt;

	
	/* File Attributes */

	wstring m_creationTime;
	wstring m_lastAccessTime;
	INT64 m_fileSize;
	bool m_isFile;


	void AnalyzeFilePath();

public:
	FileMachine(HWND parent, const wstring& filePath)
		: FilerFrogElement(parent), m_filePath(filePath) 
	{
		AnalyzeFilePath();
	}

	FileMachine() {}

	void Path(wstring& retVal);
	void Folder(wstring& retVal);
	void Extension(wstring& retVal);
	void NamePlusExt(wstring& retVal);
	void NameNoExt(wstring& retVal);
	void PathPlusNameNoExt(wstring& retVal);
	void CreationTime(wstring& retVal);
	void LastAccessTime(wstring& retVal);
	int GetLineCount(const wstring& fileName);
	INT64 FileSize();
	bool IsFile();

	void AppendToFileNameWithPath(const wstring& prefix, const wstring& postfix, wstring& retVal);
	void MimeType(wstring& retVal);
};